<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
	<head>
	<base href="<%=basePath%>">
	<link href="<%=basePath %>res/yyf/css/reset.css" rel="stylesheet" media="screen" type="text/css" />
	<link href="<%=basePath %>res/yyf/css/supersized.css" rel="stylesheet" media="screen" type="text/css" />
	<link href="<%=basePath %>res/yyf/css/style.css" rel="stylesheet" media="screen" type="text/css" />
	
	<script src="<%=basePath %>/res/yyf/js/jquery-1.8.2.min.js"></script>
	<script src="<%=basePath %>/res/yyf/js/supersized.3.2.7.min.js"></script>
	<script src="<%=basePath %>/res/yyf/js/supersized-init.js"></script>
	<script src="<%=basePath %>/res/yyf/js/scripts.js"></script>
	<script src="<%=basePath %>/res/yyf/js/jquery-1.8.2.min.js"></script>
	<style>
		ul li{
			list-style:none;
		}
	</style>
	<base href="<%=basePath %>" />
	<meta charset="UTF-8">
	<title>登录</title>
	</head>
		<body style="background-color:#fff;">
			 <div class="page-container">
					<!-- 表单方法隐藏 -->
		            <form action="<%=basePath %>loginandregist/loginSubmit" method="post">
		              <img class="content" src="pages/imagesYYF/饿了么.png" width="270px" height="90px">
						<table>
							<div class="content">
								<ul>
									<li>
										<!-- 输入框 -->
										<input id="userName" name="userName" type="text" required="请输入用户名" placeholder="用户名" size="12"/></li>
									<li>
										<input id="userPwd" name="userPwd" type="password" required="请输入密码" placeholder="密码" size="12" /></li>
								</ul>
							</div>
							
							<!-- 鼠标点击跳转 -->
							<tr>
								<td><a class="buttonCss" href="<%=basePath %>/pages/yyf/regist.jsp" style="width:100px;position:relative;left:21px;top:40px;" />注册~</a>
								<button  class="buttonCss" id="btnLogin" type="submit" onclick="myLogin();"  style="width:100px;position:relative;left:81px;top:40px;">登录~</button></td>
							</tr>
							<tr>
								<td colspan="2" style="color: red;position: relative;top:-50px;left:50px;">${info }</td>
							</tr>
						</table>
			
		            </form>
					<div id="null">
					
					</div>
		            <div class="connect">
					
					<br>
					<br>
					<br>
		                <p>
							<!-- 链接 -->
		                    <a class="facebook" href=""></a>
		                    <a class="twitter" href=""></a>
		                </p>
		            </div>
		        </div>
				<h2 style="color:orange">${mes}</h2>
				<!-- 简介单位 -->
		        <div align="center"> Copyright 2007 - 2020 vancl.com All Rights Reserved 长ID证110号 长公网安备xiangzhanglu110号</div>
				
				<br>
				
				<div><a>出版物经营许可证新出发长批字第直110120号</a> <a>饿了么一度教育）软件有限公司</a></div>
		</body>
		
				
		<script src="<%=basePath %>res/yyf/js/jquery.min.js"></script>
		<script><!-- 脚本 -->
		
		//设置cookie
		function getCookie(str) {
			var arr = document.cookie.match(new RegExp("(^| )" + str + "=([^;]*)(;|$)"));
			
			if (arr != null) {
				//unescape() 函数可对通过 escape() 编码的字符串进行解码。
				return unescape(arr[2]);
			}
			return null;
		}
		var name = getCookie("userName");
		var pwd = getCookie("userPwd");
		
		function myLogin() {
			var username = document.getElementById("userName").value;
			var password = document.getElementById("userPwd").value;
			
			//当昵称为空的时候则提示昵称不能为空
			if (username == null || username == "") {
				username.innerHTML="<font color='red'>请输入用户名</font>";
			}//当密码为空的时候则提示密码不能为空
			else if (password == null || password == "") {
				password.innerHTML="<font color='red'>请输入密码</font>";
			}//当昵称不正确或者密码不正确时提示昵称或密码错误
		}
				
		</script>
</html>